<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改工作记录')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-crmWorkRecord-edit" th:object="${workRecord}">
            <input id="workId" name="workId" th:field="*{workId}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">员工姓名：</label>
				<div class="col-sm-8">
					<input id="userName" name="userName" th:field="*{userName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">客户名称：</label>
				<div class="col-sm-8">
					<input id="customerName" name="customerName" th:field="*{customerName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">是否新客户：</label>
				<div class="col-sm-8">
					<select id="isNew" name="isNew" class="form-control m-b">
						<option value=""  th:field="*{isNew}">---请选择---</option>
						<option value="新客户" th:field="*{isNew}">新客户</option>
						<option value="老客户" th:field="*{isNew}">老客户</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">工作类型：</label>
				<div class="col-sm-8">
					<select id="workType" name="workType" class="form-control m-b">
						<option value=""  th:field="*{workType}">---请选择---</option>
						<option value="0" th:field="*{workType}">电话</option>
						<option value="1" th:field="*{workType}">拜访</option>
						<option value="2" th:field="*{workType}">提案</option>
						<option value="3" th:field="*{workType}">签约</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">工作开始时间：</label>
				<div class="col-sm-8">
					<input type="datetime" class="time-input form-control" id="startTime"
						   placeholder="开始时间" name="startTime"
						   th:value="${#dates.format(workRecord.startTime,'yyyy-MM-dd HH:mm:ss')}"/>

				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">工作结束时间：</label>
				<div class="col-sm-8">
					<input type="datetime" class="time-input form-control" id="endTime"
						   placeholder="开始时间" name="endTime"
						   th:value="${#dates.format(workRecord.endTime,'yyyy-MM-dd HH:mm:ss')}"/>

				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">事项：</label>
				<div class="col-sm-8">
					<input id="item" name="item" th:field="*{item}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">地址：</label>
				<div class="col-sm-8">
					<input id="address" name="address" th:field="*{address}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">创建人：</label>
				<div class="col-sm-8">
					<input id="createUser" name="createUser" th:field="*{createUser}" class="form-control" type="text" readonly>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">创建时间：</label>
				<div class="col-sm-8">
					<input id="createTime" name="createTime" placeholder="创建时间" readonly
						   type="datetime" class="time-input form-control" th:value="${#dates.format(workRecord.createTime,'yyyy-MM-dd HH:mm:ss')}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">更新时间：</label>
				<div class="col-sm-8">
					<input id="updateTime" name="updateTime" placeholder="更新时间"
						   type="datetime" class="time-input form-control" th:value="${#dates.format(workRecord.updateTime,'yyyy-MM-dd HH:mm:ss')}">
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "crm/work";
		$("#form-crmWorkRecord-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});

		layui.use(['laydate'], function(){
			var laydate = layui.laydate;
			//执行一个laydate实例
			laydate.render({
				elem: '#startTime', //指定元素
				type: 'datetime'
			});
            laydate.render({
                elem: '#endTime', //指定元素
                type: 'datetime'
            });
            laydate.render({
                elem: '#createTime', //指定元素
                type: 'datetime'
            });
            laydate.render({
                elem: '#updateTime', //指定元素
                type: 'datetime'
            });
		});

		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-crmWorkRecord-edit').serialize());
	        }
	    }


	</script>
</body>
</html>
